@if (advancedMode()) {
  <ix-fieldset [title]="'Encryption Options' | translate" [formGroup]="form">
    <ix-checkbox
      formControlName="inherit_encryption"
      [label]="inheritEncryptionLabel()"
      [tooltip]="helptext.encryption.inheritTooltip | translate"
    ></ix-checkbox>
    @if (!isInheritingEncryption) {
      <ix-checkbox
        formControlName="encryption"
        [label]="'Encryption' | translate"
        [tooltip]="helptext.encryption.encryptionTooltip | translate"
      ></ix-checkbox>
      @if (hasEncryption) {
        @if (!parentHasPassphrase()) {
          <ix-select
            formControlName="encryption_type"
            [label]="'Encryption Type' | translate"
            [required]="true"
            [options]="encryptionTypeOptions$"
            [tooltip]="helptext.encryption.typeTooltip | translate"
          ></ix-select>
        }
        @if (!isPassphrase) {
          <ix-checkbox
            formControlName="generate_key"
            [label]="'Generate Key' | translate"
            [tooltip]="helptext.encryption.generateKeyTooltip | translate"
          ></ix-checkbox>
        }
        @if (!isPassphrase && !form.value.generate_key) {
          <ix-textarea
            formControlName="key"
            [label]="'Key' | translate"
            [required]="true"
          ></ix-textarea>
        }
        @if (isPassphrase) {
          <ix-input
            formControlName="passphrase"
            type="password"
            [label]="'Passphrase' | translate"
            [tooltip]="helptext.encryption.passphraseTooltip | translate"
          ></ix-input>
        }
        @if (isPassphrase) {
          <ix-input
            formControlName="confirm_passphrase"
            type="password"
            [label]="'Confirm Passphrase' | translate"
          ></ix-input>
        }
        @if (isPassphrase) {
          <ix-input
            formControlName="pbkdf2iters"
            type="number"
            [label]="ignoreTranslation('pbkdf2iters')"
            [tooltip]="helptext.encryption.pbkdf2itersTooltip | translate"
          ></ix-input>
        }
        <ix-select
          formControlName="algorithm"
          [label]="'Algorithm' | translate"
          [required]="true"
          [options]="algorithmOptions$"
          [tooltip]="helptext.encryption.algorithmTooltip | translate"
        ></ix-select>
      }
    }
  </ix-fieldset>
}
